home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / mkdir / mkdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-27  |  1.0 KB  |  43 lines

  1. /*
  2.  * Copyright (c) 1983 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that this notice is preserved and that due credit is given
  7.  * to the University of California at Berkeley. The name of the University
  8.  * may not be used to endorse or promote products derived from this
  9.  * software without specific prior written permission. This software
  10.  * is provided ``as is'' without express or implied warranty.
  11.  */
  12.  
  13. #ifndef lint
  14. char copyright[] =
  15. "@(#) Copyright (c) 1983 Regents of the University of California.\n\
  16.  All rights reserved.\n";
  17. #endif /* not lint */
  18.  
  19. #ifndef lint
  20. static char sccsid[] = "@(#)mkdir.c    5.2 (Berkeley) 5/6/88";
  21. #endif /* not lint */
  22.  
  23. #include <stdio.h>
  24.  
  25. main(argc, argv)
  26.     int argc;
  27.     char **argv;
  28. {
  29.     int err;
  30.  
  31.     if (argc < 2) {
  32.         fputs("usage: mkdir directory ...\n", stderr);
  33.         exit(1);
  34.     }
  35.     for (err = 0; *++argv;)
  36.         if (mkdir(*argv, 0777) < 0) {
  37.             fputs("mkdir: ", stderr);
  38.             perror(*argv);
  39.             ++err;
  40.         }
  41.     exit(err ? 1 : 0);
  42. }
  43.